package com.qyx.pmpucat.enums;


import lombok.Getter;

import java.util.Arrays;

/**
 * 问卷类型枚举
 */
@Getter
public enum QuestionnaireTypeEnum {
    /**
     * 问题性手机使用
     */
    CAT(0, "问题性手机使用", ""),
    /**
     * 外倾性
     */
    EXTRAVERSION(1, "外倾性", "Extraversion"),

    /**
     * 宜人性
     */
    AGREEABLENESS(2, "宜人性", "Agreeableness"),

    /**
     * 尽责性
     */
    CONSCIENTIOUSNESS(3, "尽责性", "Conscientiousness"),

    /**
     * 神经质
     */
    NEUROTICISM(4, "神经质", "Neuroticism"),

    /**
     * 开放性
     */
    OPENNESS(5, "开放性", "Openness to Experience"),

    /**
     * 问卷
     */
    QUESTIONNAIRE(6, "问卷", "");
    private final Integer type;
    private final String name;
    private final String value;

    QuestionnaireTypeEnum(Integer type, String name, String value) {
        this.type = type;
        this.name = name;
        this.value = value;
    }

    public static QuestionnaireTypeEnum getByType(Integer type) {
        return Arrays.stream(QuestionnaireTypeEnum.values()).filter(i -> i.getType().equals(type))
                .findFirst().orElse(null);

    }

}
